package com.zhicheng.mapper;

import com.zhicheng.pojo.Banner;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BannerMapper {

    @Select("select * from banner")
    List<Banner> getBanner();

    @Insert("insert into banner(imgUrl, create_time, update_time) VALUES(#{imgUrl},#{createTime},#{updateTime}) ")
    void addBanner(Banner banner);

    @Update("update banner set imgUrl = #{imgUrl},update_time = #{updateTime} where id = #{id}")
    void updateBanner(Banner banner);

    @Delete("delete from banner where id = #{id}")
    void deleteBanner(Long id);
}
